package com.foreknow.demo5;

import com.foreknow.demo4.Person;

public class Demo1 {
    public void m1(int a) {

    }

    public double m2(double a) {
        return a;
    }

    public void m3(String s) {

    }

    public String  m4(String s) {
        return "";
    }

    public void m5(String[] s) {

    }

    public String[] m6(String[] s) {
        return s;
    }

    public void m7(Person person) {


    }

    public Person m8() {
        Person person = new Person();
        person.setName("gibson");
        return person;
    }

    public void m9(Pet pet) {

    }

    public Pet m10(Pet pet) {//Pet指的是父类中，其父类包含对象的各种属性
        return pet;
    }

    public static void main(String[] args) {
        Demo1 demo1 = new Demo1();
        demo1.m1(23);

        double aaa = demo1.m2(3.14);
        System.out.println("aaa");

        demo1.m3("tom");

        String name = demo1.m4("fender");
        System.out.println(name);

        String[] str = new String[]{"AAA","BBB","CCC"};
        demo1.m5(str);

        String[] ss = demo1.m6(str);
        for (int i = 0; i < ss.length; i++) {
            System.out.println(ss[i]);
        }

        Person e = new Person();
        demo1.m7(e);

        Person person = demo1.m8();
        System.out.println(person.getName());

        Pet pet = new Dog();
        demo1.m9(pet);

        Pet p = new Dog();
        Pet ppp = demo1.m10(p);
        System.out.println(ppp.getName());

        }

    }

